--SELECT * FROM cv_certification
--DELETE FROM cv_certification
INSERT INTO cv_certification
SELECT
case len(convert(varchar(10),id))
    when 6 then '00000000-0000-0000-0000-000000' + convert(varchar(10),id)
    when 5 then '00000000-0000-0000-0000-0000000' + convert(varchar(10),id) 
    when 4 then '00000000-0000-0000-0000-00000000' + convert(varchar(10),id) 
    when 3 then '00000000-0000-0000-0000-000000000' + convert(varchar(10),id) 
    when 2 then '00000000-0000-0000-0000-0000000000' + convert(varchar(10),id) 
    when 1 then '00000000-0000-0000-0000-00000000000'+ convert(varchar(10),id) 
    end As Id,Certname AS [CertificationName],NULL AS [QualifiedCertification],GotYear AS [DateQualified],Results AS [Score],'00000000-0000-0000-0000-00000' + convert(varchar(7),resumeid) AS  [ResumeId],Createddate AS [DateCreated],updateddate AS [LastUpdated]FROM srv_lnk.nchr2008.dbo.ResumeCertificate
where resumeid in (select right(id,7) from cv_resume)

--SELECT TOP 1000 * FROM srv_lnk.nchr2008.dbo.ResumeCertificate where not otherinfo is null

--select top 1 id FROM srv_lnk.nchr2008.dbo.ResumeCertificate
--order by id desc
